
If ProcessExists("Rogue Tools.exe") Then
	$f = 0
Else
	MsgBox(4096, "Rogue Tools?", "You need to be running Rogue Tools in order to use this control")
	Exit
EndIf

$filepr = FileOpen(".\chocovars.txt", 0)
$speeden = FileReadLine($filepr, 1)
$rom = FileReadLine($filepr, 2)
FileClose($filepr)
GUICreate("XChoc", 200, 210, 0, -1)
; ----------------------------------------------------------------------------
;GUICtrlCreateGroup("Version", 10, 245, 60, 55)
;GUISetFont(18, 600)
;GUICtrlCreateLabel("1.0", 15, 260, 40, 30)
;GUISetFont(9, 400)
;GUICtrlCreateGroup("", -99, -99, 1, 1)
; ----------------------------------------------------------------------------
GUICtrlCreateGroup("Roaming Distance", 10, 10, 180, 75)
$romnumber = GUICtrlCreateSlider(15, 30, 170, 30)
GUICtrlSetLimit(-1, 3, 1)
If $rom = 1 Then
	GUICtrlSetData($romnumber, 1)
EndIf
If $rom = 2 Then
	GUICtrlSetData($romnumber, 2)
EndIf
If $rom = 3 Then
	GUICtrlSetData($romnumber, 3)
EndIf
GUICtrlCreateLabel("Short", 15, 60, 50, 20)
GUICtrlSetFont(-1, 9, 450)
GUICtrlSetColor(-1, 0xff0000)
GUICtrlCreateLabel("Medium", 78, 60, 55, 20)
GUICtrlSetFont(-1, 9, 450)
GUICtrlSetColor(-1, 0xff0000)
GUICtrlCreateLabel("Far", 162, 60, 20, 20)
GUICtrlSetFont(-1, 9, 450)
GUICtrlSetColor(-1, 0xff0000)
GUICtrlCreateGroup("", -99, -99, 1, 1)
; ----------------------------------------------------------------------------
GUICtrlCreateGroup("Chocobo Dig Level", 10, 90, 180, 75)
$speednumbere = GUICtrlCreateSlider(15, 110, 170, 30)
GUICtrlSetLimit(-1, 3, 1)
If $speeden = 1 Then
	GUICtrlSetData($speednumbere, 1)
EndIf
If $speeden = 2 Then
	GUICtrlSetData($speednumbere, 2)
EndIf
If $speeden = 3 Then
	GUICtrlSetData($speednumbere, 3)
EndIf
GUICtrlCreateLabel("Lvl 1-2", 15, 140, 50, 20)
GUICtrlSetFont(-1, 9, 450)
GUICtrlSetColor(-1, 0xff0000)
GUICtrlCreateLabel("Lvl 3-4", 82, 140, 55, 20)
GUICtrlSetFont(-1, 9, 450)
GUICtrlSetColor(-1, 0xff0000)
GUICtrlCreateLabel("Lvl 4+", 148, 140, 40, 20)
GUICtrlSetFont(-1, 9, 450)
GUICtrlSetColor(-1, 0xff0000)
GUICtrlCreateGroup("", -99, -99, 1, 1)

$OKchoco = GUICtrlCreateButton("RUN", 10, 175, 80, 25)
$EXIT = GUICtrlCreateButton("EXIT", 110, 175, 80, 25)

GUISetState()
While 1
	$msg = GUIGetMsg()
	If $msg = $EXIT Then
		Exit
	EndIf
	If $msg = $OKchoco Then
		cococ()
		cocor()
	EndIf
	If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
; ----------------------------------------------------------------------------
Func cococ()
	$filechoco = FileOpen(".\XChocvars.txt", 2)
	FileWrite($filechoco, GUICtrlRead($speednumbere) & @CRLF)
	FileWrite($filechoco, GUICtrlRead($romnumber) & @CRLF)
	FileClose($filechoco)
EndFunc ;==>cococ
; ----------------------------------------------------------------------------
Func cocor()
	Run(".\XChoc.exe")
	Exit
EndFunc ;==>cocor
